home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 3 / Gold Medal Software - Volume 3 (Gold Medal) (1994).iso / music / 5mods_1.arj / BBSLIST.MOD next >
Text File  |  1994-01-26  |  6KB  |  205 lines

  1. BBSLIST.MOD              Thunder  @  Thunder Inc. 609-627-7279   
  2.  
  3. I stole this from somewere dont remember where but it din't look right
  4. so i spruced it up a little added a little color and wala all credit goes 
  5. to whoever made it the first time.
  6.  
  7. Replace void bbslist(void) with this one then read bottom footnote!!!
  8.  
  9. BTW: Don't blame me it works fine here!!!
  10.  
  11.  
  12.  
  13. void bbslist(void)
  14. {
  15.   int i,f,done,ok;
  16.   char s[150],s1[150],ch,ch1,*ss,s2[150],s3[81];
  17.   char phone[13], name[31], speed[6], type[11], meg[11], nup[11], group[11],
  18.        comment[31];
  19.   long l,l1;
  20.  
  21.   done=0;
  22.   do {
  23.     helpl=0;
  24.     nl();
  25.     prt(3,get_string(489));
  26.     ch=onek("QRNA");
  27.     switch(ch) {
  28.       case 'Q':
  29.         done=1;
  30.         break;
  31.       case 'R':
  32.         printfile("BBSLIST.MSG");
  33.         if (okansi())
  34.           npr("\x1b[%dA",1);
  35.         
  36. pl("9══════════════════════════════╧════════════╧══════════════╧════════════════");
  37.         break;
  38.       case 'N':
  39.         print_net_listing(0);
  40.         break;
  41.       case 'A':
  42.         helpl=25;
  43.         if ((actsl<=10)) {
  44.           nl();
  45.           nl();
  46.           pl(get_string(490));
  47.           nl();
  48.           break;
  49.         }
  50.         if (thisuser.restrict & restrict_automessage) {
  51.           nl();
  52.           nl();
  53.           pl(get_string(491));
  54.           nl();
  55.           break;
  56.         }
  57.         nl();
  58.         pl(get_string(492));
  59.         pl(get_string(493));
  60.         outstr(":");
  61.         mpl(12);
  62.         input(phone,12);
  63.         if ((phone[3]!='-') || (phone[7]!='-'))
  64.           phone[0]=0;
  65.         for (i=0; i<12; i++) {
  66.           if (strchr("0123456789-",phone[i])==0)
  67.             phone[0]=0;
  68.         }
  69.         if (strlen(phone)==12) {
  70.           ok=1;
  71.           sprintf(s1,"%sBBSLIST.MSG",syscfg.gfilesdir);
  72.           f=sh_open1(s1,O_RDONLY | O_BINARY);
  73.           if (f>0) {
  74.             sh_lseek(f,0L,SEEK_SET);
  75.             l=filelength(f);
  76.             if ((ss=malloca(l+500L))==NULL) {
  77.               sh_close(f);
  78.               return;
  79.             }
  80.             sh_read(f,ss,(int)l);
  81.             l1=0L;
  82.             while ((l1<l) && (ok)) {
  83.               i=0;
  84.               do {
  85.                 ch=ss[l1++];
  86.                 s1[i]=ch;
  87.                 if (ch==13)
  88.                   s1[i]=0;
  89.                 ++i;
  90.               } while ((ch!=10) && (i<120) && (l1<l));
  91.               if (strstr(s1,phone)!=NULL)
  92.                 ok=0;
  93.               if (strncmp(s1,phone,12)==0)
  94.                 ok=0;
  95.             }
  96.             farfree(ss);
  97.             sh_close(f);
  98.           }
  99.           if (ok) {
  100.             pl(get_string(494));
  101.             nl();
  102.             nl();
  103.             pl(get_string(495));
  104.             outstr(":");
  105.             mpl(30);
  106.             inputl(name,30);
  107.             nl();
  108.             pl(get_string(496));
  109.             pl(get_string(497));
  110.             outstr(":");
  111.             mpl(4);
  112.             input(speed,4);
  113.             nl();
  114.             pl(get_string(498));
  115.             outstr(":");
  116.             mpl(9);
  117.             input(type,9);
  118.             nl();
  119.            pl("How much hard disk space does this BBS has?");
  120.            outstr(":");
  121.            mpl(10);
  122.            inputl(meg,10);
  123.            if (meg[0]==0)
  124.              strcpy(meg,"Unknown");
  125.            nl();
  126.            pl("What is the new user password?");
  127.            outstr(":");
  128.            mpl(10);
  129.            inputl(nup,10);
  130.            if (nup[0]==0)
  131.              strcpy(nup,"None");
  132.            nl();
  133.            pl("Enter Network or Group Affiliations");
  134.            outstr(":");
  135.            mpl(10);
  136.            inputl(group,10);
  137.            if (group[0]==0)
  138.              strcpy(group,"None");
  139.            nl();
  140.            pl("Enter Comment About This BBS");
  141.            outstr(":");
  142.            mpl(30);
  143.            inputl(comment,30);
  144.            nl();
  145.            
  146. sprintf(s3,"9══════════════════════════════╪════════════╪══════════════╪════════════════\r\n");
  147.            sprintf(s,"2%-30s9│2 %-10s9 │2 %-12s9 │2 %-5s\r\n9",name, type, phone, speed);
  148.            sprintf(s2,"8%-30s9│8 %-10s9 │8 %-12s9 │8 %-5s\r\n9",comment, meg, nup, group);
  149.            nl();
  150.            nl();
  151.            pl(s);
  152.            if (okansi())
  153.              npr("\x1b[%dA",1);
  154.            pl(s2);
  155.            nl();
  156.            prt(9,get_string(499));
  157.             if (yn()) {
  158.               sprintf(s1,"%sBBSLIST.MSG",syscfg.gfilesdir);
  159.               f=sh_open(s1,O_RDWR | O_CREAT | O_BINARY, S_IREAD | S_IWRITE);
  160.               if (filelength(f)) {
  161.                 sh_lseek(f,-1L,SEEK_END);
  162.                 sh_read(f,((void *)&ch1),1);
  163.                 if (ch1==26)
  164.                   sh_lseek(f,-1L,SEEK_END);
  165.               }
  166.               sh_write(f,(void *)s3,strlen(s3));
  167.               sh_write(f,(void *)s,strlen(s));
  168.               sh_write(f,(void *)s2,strlen(s2));
  169.               sh_close(f);
  170.               nl();
  171.               pl(get_string(500));
  172.             }
  173.           } else {
  174.             pl(get_string(501));
  175.             nl();
  176.             nl();
  177.           }
  178.         } else {
  179.           nl();
  180.           pl(get_string(502));
  181.           nl();
  182.         }
  183.         break;
  184.     }
  185.   } while ((!done) && (!hangup));
  186. }
  187.  
  188.  
  189. --------------------------------------------------------------------------
  190.  
  191.                      4  Thunder Inc. BBS Listing4  0
  192.  
  193. 9══════════════════════════════╤════════════╤══════════════╤════════════════
  194. 2BBS Name                9      │2 Software 9  │2 Phone Number9 │2 Speed
  195. 8Comment On BBS          9      │8 HD Space 9  │8 New User Pwd9 │8 Group
  196. 9══════════════════════════════╧════════════╧══════════════╧════════════════
  197.  
  198. -----------------------------------------------------------------------------
  199.  
  200. Cut out above not the lines above and below just whats in the middle cut it
  201. out and save it as bbslist.msg then copy it to gfiles section 
  202. go into misccmd.c and replace void (bbslist) with this one change the color
  203. if you want to   BTW back up your sourcey's and back up your bbslist.msg if 
  204. they mean anything to you.
  205.